﻿<%@ Page Title="" Language="C#" MasterPageFile="~/UI/UserUI/User.Master" AutoEventWireup="true" CodeBehind="PurchaseReturnEntry.aspx.cs" Inherits="BoutiquePOS.UI.UserUI.PurchaseReturnEntry" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="../../Styles/UserUI/DivStyle.css" rel="stylesheet" type="text/css" />
    <link href="../../Styles/UserUI/Button.css" rel="stylesheet" type="text/css" />
    <link href="../../Styles/UserUI/style.css" rel="stylesheet" type="text/css" />
    
    <script language="javascript" type="text/javascript">
        function validation() {
            if (document.getElementById('<% =purchaseNoTextBox.ClientID %>').value == "") {
                document.getElementById('<%=messageResult.ClientID %>').textContent = "Purchase no cannot be blank ";
                document.getElementById('<%=messageResult.ClientID%>').style.color = "red";
                document.getElementById('<% =purchaseNoTextBox.ClientID %>').focus();
                return false;
            }
            return true;
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <fieldset>
        <legend style="color: blue">|| Purchase Return Entry ||</legend>
        <div class="divRow">
            <div class="divColumn">
                <div>
                    <label>
                        Purchase No.</label></div>
            </div>
            <div class="divColumn">
                <div>
                    <input type="text" id="purchaseNoTextBox" runat="server" />
                    <input type="submit" value="Search" id="searchButton" runat="server" onserverclick="SearchButton"
                        class="myButton" onclick="return searchButton_onclick()" />
                </div>
            </div>
            <div class="divColumn">
                <div>
                    <label>
                        Return Date</label></div>
            </div>
            <div class="divColumn">
                <div>
                    <input type="text" id="returnDateTextBox" runat="server" /></div>
            </div>
        </div>
    </fieldset>
    <fieldset>
        <div>
            <asp:GridView ID="purchaseReturnGridView" runat="server" AutoGenerateColumns="False"
                CellPadding="4" ForeColor="#333333" Width="849px" OnRowCancelingEdit="purchaseReturnGridView_RowCancelingEdit"
                OnRowEditing="purchaseReturnGridView_RowEditing" OnRowUpdating="purchaseReturnGridView_RowUpdating">
                <AlternatingRowStyle BackColor="White" />
                <Columns>
                    <asp:TemplateField HeaderText="Purchase Id" Visible="False">
                        <ItemTemplate>
                            <asp:Label ID="lblPurchaseId" runat="server" Text='<%# Bind("PurchaseId") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Product Id" Visible="False">
                        <ItemTemplate>
                            <asp:Label ID="lblProductId" runat="server" Text='<%# Bind("AProduct.ProductId") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Product Name">
                        <ItemTemplate>
                            <asp:Label ID="lblProductBrandName" runat="server" Text='<%# Bind("AProduct.ProductBrandName") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Purchase Qty">
                        <ItemTemplate>
                            <asp:Label ID="lblPurchaseQty" runat="server" Text='<%# Bind("PurchaseQty") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Free Qty">
                        <ItemTemplate>
                            <asp:Label ID="lblPurchaseFreeQty" runat="server" Text='<%# Bind("PurchaseFreeQty") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="TP">
                        <ItemTemplate>
                            <asp:Label ID="lblTradePrice" runat="server" Text='<%# Bind("TradePrice") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="VAT">
                        <ItemTemplate>
                            <asp:Label ID="lblVat" runat="server" Text='<%# Bind("Vat") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <%--<asp:TemplateField HeaderText="TotalTP">
                        <ItemTemplate>
                            <asp:Label ID="lblTotalTP" runat="server" Text='<%# Bind("TotalTP") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="TotalVat">
                        <ItemTemplate>
                            <asp:Label ID="lblTotalVat" runat="server" Text='<%# Bind("TotalVat") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>--%>
                    <asp:TemplateField HeaderText="Dis. Per">
                        <ItemTemplate>
                            <asp:Label ID="lblDiscountPer" runat="server" Text='<%# Bind("DiscountPer") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="RtnQty">
                        <EditItemTemplate>
                            <asp:TextBox ID="txtReturnQty" runat="server" Text='<%# Bind("ReturnQty") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="lblReturnQty" runat="server" Text='<%# Bind("ReturnQty") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="RtnFreeQty">
                        <EditItemTemplate>
                            <asp:TextBox ID="txtFreeReturnQty" runat="server" Text='<%# Bind("ReturnFreeQty") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="lblReturnFreeQty" runat="server" Text='<%# Bind("ReturnFreeQty") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:CommandField ShowEditButton="True" />
                    <asp:CommandField ShowSelectButton="True" />
                </Columns>
                <EditRowStyle BackColor="#7C6F57" />
                <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#E3EAEB" />
                <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#F8FAFA" />
                <SortedAscendingHeaderStyle BackColor="#246B61" />
                <SortedDescendingCellStyle BackColor="#D4DFE1" />
                <SortedDescendingHeaderStyle BackColor="#15524A" />
            </asp:GridView>
        </div>
        <br />
    </fieldset>
    <fieldset>
        <div class="divRow">
            <div class="divColumn">
                <div>
                    <p id="messageResult" runat="server">
                    </p>
                </div>
            </div>
            <div class="divColumn">
                <div>
                    <input type="submit" value="Save" id="saveButton" runat="server" onserverclick="SavePurchaseReturn"
                        class="myButton" onclick="javascript:return validation()"/>&nbsp;
                    <input type="submit" value="Clear" id="clearButton" runat="server" onserverclick="ClearButton"
                        class="myButton" />&nbsp;
                    <input type="submit" value="Close" id="closeButton" runat="server" onserverclick="CloseButton"
                        class="myButton" />&nbsp;
                    <%--<input type="submit" value="Delete" id="deleteButton" runat="server" onserverclick="DeleteButton" class="myButton"/>--%>
                </div>
            </div> 
        </div>
    </fieldset>
</asp:Content>

<%--<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
</asp:Content>--%>
